<template>
  <div class = "choice-question">
    <div class="title">
        <h2>第{{question.index+1}}题</h2>
    </div>
    <p class="quest">{{question.title}}</p>
    <div class="btn" id="next-button">
      <button v-on:click="submit(question.index, question.type == 'single')">下一题</button>
    </div>
  </div>
</template>

<script>
var status  = 'start';
this.creatData=function (index){
  console.log('---------- 需要引入asset里面的json文件');

  $.getJSON('question.json',function(data){
	  console.log(data);
  });
}
this.creatData(0)
export default {
  name: 'quest',
  data () {
    return {
      question: {
        "index":0,
        "title":"你头发长吗？",
        "type":"single",
        "answers":[
            {"id":"1-1","content":"1-2cm"},
            {"id":"1-2","content":"3-6cm"},
            {"id":"1-3","content":"7-10cm"}
            ]}
    }
  },
  methods: {
    submit: function (message, event) {
      alert(message)
    }
  }
}
</script>
